﻿using AnesSystem.Models;
using AnesSystem.Services;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AnesSystem.ViewModels
{
    public class RoleListCtrlViewModel:BaseViewModel<RoleListCtrlViewModel>
    {
        #region Variables

        private ObservableCollection<RoleModel> _roleList;

        #endregion

        #region Constructor

        public RoleListCtrlViewModel()
        {
            _roleList = new ObservableCollection<RoleModel>();
        }


        #endregion

        #region Properties

        public ObservableCollection<RoleModel> RoleList
        {
            get
            {
                return _roleList;
            }

            set
            {
                _roleList = value;
                RaisePropertyChanged("RoleList");
            }
        }

        #endregion

        #region 依赖属性

        #endregion

        #region Event

        #endregion

        #region Private Methods

        private void InitialRoles()
        {
           IEnumerable<RoleModel> list = RoleService.Instance.FindAll();
            foreach(var item in list)
            {
                RoleList.Add(item);
            }
        }

        #endregion

        #region Public/Protected Methods

        #endregion

        #region EventHandlers

        #endregion
    }
}
